home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / lib / lmfunct.pro < prev    next >
Text File  |  1997-07-08  |  822b  |  26 lines

  1. ; $Id: lmfunct.pro,v 1.3 1997/01/15 03:11:50 ali Exp $
  2. ;
  3. ; Copyright (c) 1988-1997, Research Systems, Inc.  All rights reserved.
  4. ;       Unauthorized reproduction prohibited.
  5.  
  6. function lmfunct,x,a
  7. ;
  8. ;       Return a vector appropriate for LMFIT
  9. ;
  10. ;       The function being fit is of the following form:
  11. ;          F(x) = A(0) + A(1)*X + A(2)*X*X 
  12. ;
  13. ;       dF/dA(0) is dF(x)/dA(0) = 1.0
  14. ;       dF/dA(1) is dF(x)/dA(1) = X
  15. ;       dF/dA(2) is dF(x)/dA(2) = X*X
  16. ;
  17. ;       return,[[F(x)],[dF/dA(0)],[dF/dA(1)],[dF/dA(2)]]
  18. ;
  19. ;       Note: returning the required function in this manner
  20. ;             ensures that if X is double the returned vector
  21. ;             is also of type double. Other methods, such as
  22. ;             evaluating size(x) are also valid.
  23. ;
  24.         return,[ [A[0]+A[1]*X+A[2]*X*X],[1.0], [X], [X*X] ]
  25. end
  26.